package com.stu.entity.sys;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.stu.entity.base.BaseEntity;
import com.stu.entity.permission.PermissionUser;

@Entity
@Table(name = "SYS_LOG")
public class SysLog extends BaseEntity {

	public static final String LOG_LEVEL_DEBUG = "DEBUG";
	public static final String LOG_LEVEL_WARN = "WARN";
	public static final String LOG_LEVEL_ERROR = "ERROR";
	public static final String LOG_LEVEL_INFO = "INFO";

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String logType;
	private String logLevel;
	private String logContent;
	private String logParam;
	private PermissionUser user;

	public SysLog(){
		
	}
	
	public SysLog(String logType, String logLevel, String logContent, String logParam) {
		this.logType = logType;
		this.logLevel = logLevel;
		this.logContent = logContent;
		this.logParam = logParam;
	}

	public SysLog(String logType, String logLevel, String logContent, String logParam, PermissionUser user) {
		super();
		this.logType = logType;
		this.logLevel = logLevel;
		this.logContent = logContent;
		this.logParam = logParam;
		this.user = user;
	}

	@Column(name = "LOG_TYPE", length = 100)
	public String getLogType() {
		return logType;
	}

	public void setLogType(String logType) {
		this.logType = logType;
	}

	@Column(name = "LOG_LEVEL", length = 10)
	public String getLogLevel() {
		return logLevel;
	}

	public void setLogLevel(String logLevel) {
		this.logLevel = logLevel;
	}

	@Column(name = "LOG_CONTENT", length = 5000)
	public String getLogContent() {
		return logContent;
	}

	public void setLogContent(String logContent) {
		this.logContent = logContent;
	}

	@Column(name = "LOG_PARAM", length = 5000)
	public String getLogParam() {
		return logParam;
	}

	public void setLogParam(String logParam) {
		this.logParam = logParam;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user")
	public PermissionUser getUser() {
		return user;
	}

	public void setUser(PermissionUser user) {
		this.user = user;
	}


}
